<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <style>

        body{
            height: 1000px;
        }

        /*选中第一个div*/
        div:nth-of-type(1){
            width: 100px;
            height: 100px;
            background: red;
            text-align: center;
            position: absolute;  /*基于浏览器定位的绝对定位*/
            right: 0px;
            bottom: 0px;
        }
        /*选中第二个div*/
        div:nth-of-type(2){
            width: 50px;
            height: 50px;
            background: yellow;
            text-align: center;
            position: fixed;  /*固定定位*/
            right: 0px;
            bottom: 0px;
        }

    </style>

</head>
<body>

<div>div1</div>
<div>div2</div>

</body>
</html>